home *** CD-ROM | disk | FTP | other *** search
- #define BALLSIZE 7
- #define BALLSIZEHALF 3
- #define PADDSIZE 41 /* odd for center */
- #define PADDSIZEHALF 20
- #define DISTANCE 1
-
- enum {
- SPACE = 49,
- UP_ARROW = 126,
- DOWN_ARROW = 125,
- LEFT_ARROW = 123,
- RIGHT_ARROW = 124
- };
-
- enum {
- STARTUP,
- PLAYING,
- PAUSED,
- OVER
- };
-
- enum {
- STATIONARY,
- CLOCKWISE,
- COUNTERCLOCKWISE
- };
-
- typedef struct {
- WindowPtr theWindow;
-
- int state;
- int paddx;
- int paddy;
-
- int ballx;
- int bally;
-
- int balldx;
- int balldy;
-
- int color;
-
- int score;
-
- } GameState;
-
- void GetGameRect(WindowPtr theWindow, Rect *gameRect);
- void GameInit(GameState *game);
- void GameStartup(GameState *game, Rect *gameRect, WindowPtr theWindow);
- void GamePlaying(GameState *game, Rect *gameRect);
- void GameMain(WindowPtr theWindow);
- void DrawGame(GameState *game, Rect *gameRect);
-
- void MoleculeSunRise(void);
- void MovePaddleClockwise(GameState *game, Rect * gameRect);
- void MovePaddleCounterClockwise(GameState *game, Rect * gameRect);
- long LeftArrowKeyIsDown(void);
- long KeyIsDown(int KeyNum);
-